﻿@using QunProject.Common;
@{
    ViewBag.Title = "安全中心";
    Layout = "~/Views/Shared/_Member.cshtml";
    var LoginMember = (QunProject.Model.member)ViewBag.LoginMember;
}

<div class="row p10 bcolor" style="overflow:auto;">
    <form class="layui-form" id="dataForm">
        <div class="layui-form-item">
            <label class="layui-form-label">绑定手机</label>
            <div class="layui-input-inline">
                <p class="print">@LoginMember.Phone.SubPhoneStr()</p>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">注册时间</label>
            <div class="layui-input-inline">
                <p class="print">@LoginMember.CreateTime</p>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">个人编号</label>
            <div class="layui-input-inline">
                <p class="print">@LoginMember.Number</p>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">旧密码</label>
            <div class="layui-input-inline">
                <input type="password" name="pwd" placeholder="旧密码" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">新密码</label>
            <div class="layui-input-inline">
                <input type="password" name="pwd1" placeholder="新密码" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">确认密码</label>
            <div class="layui-input-inline">
                <input type="password" name="pwd2" placeholder="确认密码" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <a class="layui-btn" onclick="javascript: { updatePwd(); }">修改密码</a>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">&nbsp;</label>
            <div class="layui-input-inline" style="width:230px;">
                如忘记密码，请点击<a href="/login/back@(ViewBag.Suffix)" class="href" target="_blank">这里</a>找回
            </div>
        </div>
    </form>
</div>

<script>
    function updatePwd() {
        var paras = $("#dataForm").getForm();
        $.post('/member/UserEditPasswordResult', paras, function (result) {
            layer.confirm('修改成功', {
                closeBtn: 0,
                btn: ['确定']
            }, function () {
                window.location.reload();
            });
        });
    };
</script>